<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript">
$(function() {
	 

	//设置表单验证
	var addForm = $("#addForm").validate( {
		rules : {
			affairItem : {
				required : true,
				rangelength : [ 2, 20 ]
			} 
		}
	});
	//提交
	$("#btn_submit")
			.click(
					function() {
						if (addForm.form()) {
							art.dialog( {
								id : "loading",
								lock : true,
								drag : false,
								resize : false,
								title : "正在提交..."
							});

							$("#addForm")
									.ajaxSubmit(function(result) {
										art.dialog( {
											id : 'loading'
										}).close();//关闭等待框

											if (result == "true") {
												art
														.dialog( {
															content : "保存成功!",
															lock : true,
															ok : function() {
																location.href = "${path}/routine/daily/index/dailylist";
															},
															cancelVal : '关闭',
															cancel : true
														});
											} else {
												art.dialog( {
													content : "保存失败!",
													lock : true,
													ok : true
												});
											}
										});
						}
					});
});
</script>
	</head>
	<body id="master">

		<sfa:mainHeader></sfa:mainHeader>
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					编辑事务
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding: 30px;">
					<div class="d_formitem">
						<form id="addForm" action="${path}/routine/daily/index/edit"
							method="post">
							<table cellspacing="0" cellpadding="0" class="formitem">
								<tr>
									<td>
										<span>营销员姓名：</span>
										<input type="hidden" value="${affairid}"
											name="salePrivateAffairId" />
									</td>
									<td>
										<span class="bigspan">${createUsername}</span>
									</td>
								</tr>
								<tr>
									<td>
										<span>事务类型：</span>
									</td>
									<td>
										<sfa:dic showType="select" kindNo="AFFAIRTYPE"
											code="${model.affairType}" attr="class='input-txt'"
											name="affairType" id="affairType"></sfa:dic>

									</td>
								</tr>
								<tr>
									<td>
										<span>事务标题：</span>
									</td>
									<td>
										<input type="text" id="affairItem" name="affairItem"
											class="input-txt" maxlength="20" value="${model.affairItem}" />
									</td>
								</tr>
								<tr>
									<td>
										<span>事务内容：</span>
									</td>
									<td>

										<textarea name="affairContent"
											style="width: 300px; height: 80px;" id="affairContent"
											class="multibox">${model.affairContent}</textarea>
									</td>
								</tr> 
								<tr>
									<td>
										事务状态:
									</td>
									<td>
										<sfa:dic showType="select" kindNo="AFFAIRSTATUS"
											code="${model.affairStatus}" attr="class='input-txt'"
											name="affairStatus" id="affairStatus"></sfa:dic>
									</td>

								</tr>
								<tr>
									<td>
									</td>
									<td>
										<input type="button" id="btn_submit" tabindex="5"
											class="linkbtn2" value="提交">
										&nbsp;&nbsp;
										<input type="button" id="btn_back" tabindex="5"
											class="linkbtn2" value="返回"
											onclick="location.href='${path}/routine/daily/index/dailylist';">
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
			</div>
			<div class="webpart-foot">
				<div class="webpart-foot-item">
				</div>
			</div>
		</div>

		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>


